package com.albaba.designpattern.chain_of_responsibility.text_001;

/**
 * @author zx
 * @version 1.0
 * @description TODO
 * @date 2025/2/24 21:24
 */
public class HandleC extends Handler {
    @Override
    public void handle(RequestData requestData) {
        System.out.println("HandleC 执行代码逻辑!处理：" + requestData.getData());

        requestData.setData(requestData.getData().replace("C", ""));

        // 判断是否继续向后调用处理器
        if (this.successor != null) {
            this.successor.handle(requestData);
        } else {
            System.out.println("HandleA 处理结束!");
        }

    }
}
